-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parser: add missed diskette geometry parsing #1312
base: devel
Are you sure you want to change the base?
Conversation
This was dropped in a6144ab but should be preserved to allow specifying custom geometry.
Needs more work. dosemu appears to override the manually entered geometry. |
Test case, using:
Here we can find that dosemu still reports the boot diskette as sectors 18, heads 2. (Cylinders 80 is implied by the 18 sectors and 2 heads and 2880 total sectors.) |
This passes all the literal values specified by using the cylinders, heads, sectors keywords. Probably requires all of the parameters to be set to work properly.
I found a way to fix it so dosemu will not select any other geometry. It is rather much of a hack though. Please review and suggest how to improve this. |
Actual use case: I'm testing bootimg's FAT32 support by formatting a "super floppy" (unpartitioned medium with a single file system). It needs to be about 34 MiB at least, with 512 bytes per sector, to make all FAT32 detections succeed (needs > 64 Ki clusters). FreeDOS and dosemu seem not to like it when the diskette image exceeds a certain size. By forcefully specifying C, H, S geometry with this patch both FreeDOS and dosemu are happy about the large image and all the disk accesses work. |
@@ -510,7 +510,8 @@ static void image_auto(struct disk *dp) | |||
leavedos(19); | |||
return; | |||
} | |||
if (!(set_floppy_chs_by_size(st.st_size, dp) || | |||
if (!(dp->default_cmos == CUSTOM_DISKETTE || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just check above (at line 499)
that chs already set (all values != 0)
and then return immediately?
Looks much simpler than adding another
keyword.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we do want the dp->num_secs =
line that comes later, to calculate the total (CHS-addressable) size though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So would you like to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will get around to it eventually. Still considering how to fix the HD image geometry specifiers too. They're also broken. For example, if we set cylinders X heads Y sectors Z (all specified) then in disk_reset2 the conditional is not taken, and thus num_secs is never initialised (stays zero) which makes read_sectors fail.
139e850
to
0e5522d
Compare
This was dropped in a6144ab
but should be preserved to allow specifying custom geometry.
Tested compilation and running the resulting dosemu2. No tests done on whether geometry is properly accepted.
Old dosemu references list these geometry specifiers, eg https://www.linuxjournal.com/article/1070 here: